<%--
  Created by IntelliJ IDEA.
  User: DY
  Date: 2021/12/31
  Time: 13:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title>权限列表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/admin.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 留言管理</strong></div>
        <div class="padding border-bottom">
            <ul class="search">
                <li>
                    <shiro:hasPermission name="permission:addUI">
                    <a  class="button border-green"  href="${pageContext.request.contextPath}/sysPermissionController/sysPermissionAddUI">增加</a>
                    </shiro:hasPermission>
                    <button type="button" class="button border-green" id="checkall"><span class="icon-check"></span> 全选
                    </button>
                    <button type="submit" class="button border-red"><span class="icon-trash-o"></span> 批量删除</button>
                </li>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th>权限ID</th>
                <th>父ID</th>
                <th>权限名称</th>
                <th>权限编号</th>
                <th>图标</th>
                <th>请求路径</th>
                <th>类型</th>
                <th>状态</th>
                <th colspan="2">操作</th>
            </tr>
            <c:forEach items="${sysPermissionList}" var="permission">
                <tr>
                    <td>${permission.permissionId}</td>
                    <td>${permission.pId}</td>
                    <td>${permission.permissionName}</td>
                    <td>${permission.permissionCode}</td>
                    <td>${permission.icon}</td>
                    <td>${permission.url}</td>
                    <td>${permission.type}</td>
                    <td>${permission.state}</td>
                    <td>
                        <shiro:hasPermission name="permission:delete">
                        <a class="button border-red" href="${pageContext.request.contextPath}/sysPermissionController/sysPermissionDelete?sysPermissionIdStr=${permission.permissionId}" >删除</a>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="permission:updaeUI">
                        <a class="button border-blue" href="${pageContext.request.contextPath}/sysPermissionController/sysPermissionUpdateUI?sysPermissionIdStr=${permission.permissionId}" >编辑</a>
                        </shiro:hasPermission>
                    </td>
                </tr>
            </c:forEach>
            <span>${message}</span>
            <tr>
                <td colspan="10">
                    <div class="pagelist"><a href="#">上一页</a> <span class="current">1</span><a href="#">2</a><a
                            href="#">3</a><a href="#">下一页</a><a href="#">尾页</a></div>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    function del(id){
        if(confirm("您确定要删除吗?")){

        }
    }

    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

    function DelSelect(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var t=confirm("您确认要删除选中的内容吗？");
            if (t==false) return false;
        }
        else{
            alert("请选择您要删除的内容!");
            return false;
        }
    }


</script>
</body>
</html>